#include "SpriteObject.hpp"

namespace sl
{
	SpriteObject::SpriteObject() : sf::Sprite()
	{}

	SpriteObject::SpriteObject(sf::Texture* img) : sf::Sprite(*img)
	{}

	SpriteObject::~SpriteObject()
	{}

	bool SpriteObject::HasATexture()
	{
		return (GetTexture() != NULL) ? true : false;
	}

	SpriteObject* SpriteObject::Update(float time)
	{
		if (GetTexture() == NULL)
			Exception("The Sprite own no Texture", ErrorCode::NoTexture);

		return this;
	}

	SpriteObject* SpriteObject::SetTexture(sf::Texture* img)
	{
		sf::Sprite::SetTexture(*img);
		return this;
	}

	std::ostream& operator<<(std::ostream& os, const SpriteObject& obj)
	{
		return os;
	}

	std::istream& operator>>(std::istream& is, SpriteObject& obj)
	{
		return is;
	}
}